//
//  FinishBasicCell.m
//  51易借
//
//  Created by 张睿 on 2017/8/31.
//  Copyright © 2017年 张睿. All rights reserved.
//

#import "FinishBasicCell.h"


@interface FinishBasicCell ()

@property (nonatomic, strong)UIImageView * rightImageView;

@end

@implementation FinishBasicCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self setupUI];
    }
    
    return self;
}


- (void)setupUI{
    
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    
    UILabel * titleLabel = [UILabel new];
    
    titleLabel.textColor = ColorWithRGB(0x303c41);
//    titleLabel.font = [UIFont fontWithName:TYPE_FACE size:14 * SCREENH6];
    titleLabel.font = [UIFont systemFontOfSize:14.5 * SCREENH6];
    titleLabel.textAlignment = NSTextAlignmentLeft;
//    titleLabel.text = @"个人信息";
    
    self.titleLabel = titleLabel;
    
    [self.contentView addSubview:self.titleLabel];
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.contentView);
        make.leading.mas_equalTo(self.contentView).offset(10 * SCREENH6);
    }];
    
    self.rightImageView = [UIImageView new];
    
    self.rightImageView.image = [UIImage imageNamed:@"倒三角-箭头"];
    
    [self.contentView addSubview:self.rightImageView];
    
    [self.rightImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.trailing.mas_equalTo(self.contentView).offset(-7 * SCREENH6);
        make.centerY.mas_equalTo(self.contentView);
        make.width.mas_equalTo(8 * SCREENH6);
        make.height.mas_equalTo(15 * SCREENH6);
    }];
    
    
    UILabel * rightLabel = [UILabel new];
    
    rightLabel.textColor = ColorWithRGB(0x7f7f7f);
//    rightLabel.font = [UIFont fontWithName:TYPE_FACE size:14 * SCREENH6];
    rightLabel.font = [UIFont systemFontOfSize:14.5 * SCREENH6];
    rightLabel.textAlignment = NSTextAlignmentRight;
    rightLabel.text = @"未完善";
    
    self.rightLabel = rightLabel;
    
    [self.contentView addSubview:self.rightLabel];
    
    [self.rightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.contentView);
        make.trailing.mas_equalTo(self.rightImageView.mas_leading).offset(-10 * SCREENH6);
    }];
    
    
    UIView * lineView = [UIView new];
    
    lineView.backgroundColor = ColorWithRGB(0xdbdbdb);
    
    self.lineView = lineView;
    
    [self.contentView addSubview:self.lineView];
    
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(self.contentView);
        make.height.mas_equalTo(1 * SCREENH6);
        make.leading.mas_equalTo(self.contentView).offset(5 * SCREENH6);
        make.trailing.mas_equalTo(self.contentView).offset(-5 * SCREENH6);
    }];
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
